﻿using Bean.SqlSugar.Core;
using Microsoft.Extensions.Options;
using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bean.Repository
{
    /// <summary>
    /// 
    /// </summary>
    public interface IBaseRepository<T> : IRepository<T> where T : class, new()
    {

    }

    public class BaseRepository<T> : Repository<T> where T : class, new()
    {
        public BaseRepository() : base(GetSugarOptions())
        {

        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        private static IOptionsMonitor<SqlSugarOptions> GetSugarOptions()
        {
            return IocManager.Resolve<IOptionsMonitor<SqlSugarOptions>>();
        }
    }
}
